Repository navigation
Conversation
Backport dotnet#135160's test-only ambient-state isolation and class-level parallelism on Windows/Linux. Preserve assembly-wide serialization on desktop macOS and the Browser assembly skip. Resolve context conflicts without importing newer tests or APIs. Omit the Windows first-chance-exception test change because that test does not exist on release/10.0. (cherry picked from commit 780c55a) Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 77e3b81a-728c-456f-97c2-210c695c4446
|
Azure Pipelines: Successfully started running 3 pipeline(s). 13 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
|
Tagging subscribers to this area: @dotnet/area-system-diagnostics-process |
adamsitnik
left a comment
There was a problem hiding this comment.
Big thanks for working on this @steveisok ! PTAL at my comment, we may not need to disable parallel tests in the 10.0 branch
| #if TARGET_OSX | ||
| // Retain serialization until process-management hangs under concurrent test classes on macOS are resolved. | ||
| // https://github.com/dotnet/runtime/issues/135294 | ||
| [assembly: CollectionBehavior(CollectionBehavior.CollectionPerAssembly)] | ||
| #endif |
There was a problem hiding this comment.
They are most likely hanging due to #131944, which was caused by change introduced in .NET 11 (or to be more exact, an existing bug has surfaced thanks to that change). So we may not need to disable it for OSX in the .NET 10 branch.
| #if TARGET_OSX | |
| // Retain serialization until process-management hangs under concurrent test classes on macOS are resolved. | |
| // https://github.com/dotnet/runtime/issues/135294 | |
| [assembly: CollectionBehavior(CollectionBehavior.CollectionPerAssembly)] | |
| #endif | |
| [assembly: CollectionBehavior(CollectionBehavior.CollectionPerAssembly)] |
| <PropertyGroup> | ||
| <TargetPlatformIdentifier>$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)'))</TargetPlatformIdentifier> | ||
| <DefineConstants Condition="'$(TargetPlatformIdentifier)' == 'windows'">$(DefineConstants);TargetsWindows</DefineConstants> | ||
| <DefineConstants Condition="'$(TargetOS)' == 'osx' and '$(TargetPlatformIdentifier)' == 'unix'">$(DefineConstants);TARGET_OSX</DefineConstants> |
There was a problem hiding this comment.
| <DefineConstants Condition="'$(TargetOS)' == 'osx' and '$(TargetPlatformIdentifier)' == 'unix'">$(DefineConstants);TARGET_OSX</DefineConstants> |
|
Hi, the code complete date for 10.0.14 (the November 2026 release) is Monday 12 October. Make sure to merge this PR on that date at the latest, or it won't make it into that release. As a reminder, if this is a product change, you also need Tactics approval before merging this PR (test-only or infra-only changes don't require Tactics approval). Happy to help with the merge if needed! |
Fixes Issue
N/A: test-only CI throughput and ambient-state isolation; no release timeout incidence has been established.
main PR
#135160, merged squash commit
780c55a27764cb5729babfcfef8de849cdf3fcaf.Description
Backport the final merged approach to
release/10.0, based on4c61b1441b4b11274d6f8b4b3bebc1147e437e78. Release has the same assembly-wide collection and host environment/console/current-directory mutations. Isolating those mutations allows default per-class collections on Windows/Linux, improving throughput/headroom without increasing timeouts.Desktop macOS retains the original assembly-wide serialization pending #135294; this does not fix or close that issue. The target-based guard applies to both Mono and CoreCLR. Browser's assembly skip and mobile behavior are unchanged.
Six test files only. Conflict resolutions preserve release tests/APIs and omit main-only context. The Windows first-chance-exception test hunk is omitted because that test does not exist on release. The Unix directory-collision test retains its platform/outer-loop traits and now intentionally requires
RemoteExecutor.IsSupported, matching main.Customer Impact
N/A: test-only CI efficiency/isolation. No shipped library binaries, product behavior, package versions, or pipeline changes. This does not establish that release CI is affected by #135001 or promise main's measured speedup on the smaller release suite.
Regression
No product regression addressed. The serialization pattern predates this backport.
Testing
Actual release-project MSBuild evaluation on Windows confirmed
TARGET_OSXonly forTargetOS=osxwith the Unix framework, for Mono and CoreCLR. Windows, Linux, Android, MacCatalyst, Browser, andosxwith a MacCatalyst framework do not enable the guard.The documented targeted
dotnet build /t:Testcommand was attempted for the four affected Windows tests but failed before Process-test compilation:eng/targetingpacks.targets:106reports a missing built shared-framework targeting pack; CoreLib also reports a Runtime Task Host SDK-version metadata error. The manifest requests SDK10.0.111; the readily installed SDK selected under its roll-forward policy is10.0.400-preview.0.26312.103. These are local prerequisites/tooling blockers, not established regressions from this patch.Bounded supplemental Roslyn compilation covered every evaluation-time
Compileitem in the Windows and Unix source sets, using installed .NET 10.0.8 references, restored release RemoteExecutor/xUnit dependencies, and .NET 10.0.12 for execution. The four affected Windows tests passed: 4 passed, 0 failed, 0 skipped, with real child/grandchild invocations. References to source-project products were supplied by installed/cached .NET 10 assemblies, not freshly built release binaries.Actual xUnit discovery on Windows found 358 Windows cases in eight class collections; the Unix variants had 407 cases in eight collections for Linux and one shared collection with the macOS guard. Unix results are cross-target metadata checks, not native-platform execution or CI payload counts.
These supplemental checks do not cover the complete official generated entrypoint/assembly metadata, resource-generation, or analyzer pipeline. Repository build/test success and native Linux/macOS/Mono/NativeAOT execution remain unverified. No broad prerequisite build, manual CI/Helix jobs, reruns, or monitoring were started; automatic PR CI must provide full verification.
Risk
Low product risk: only tests change. Intentional Windows/Linux concurrency carries test-scheduling risk, mitigated by moving process-wide environment, console-code-page, and current-directory mutations out of the runner. The Windows child allocates a private console and reports native failures; fixture disposal retains child cleanup. macOS preserves its prior serial scheduling.
Area-owner review and the applicable servicing approval remain required; this PR does not assert either approval or green CI.
Package authoring no longer needed in .NET 9
IMPORTANT: Starting with .NET 9, you no longer need to edit a NuGet package's csproj to enable building and bump the version.
Keep in mind that we still need package authoring in .NET 8 and older versions.
N/A: this backport changes tests only.